home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1996 #14
/
Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO
/
pcboard
/
msgtag11.zip
/
MEC.PPS
< prev
next >
Wrap
Text File
|
1996-01-30
|
12KB
|
364 lines
; MEC.PPE by Dan Shore - SysOp
; The Shoreline BBS
;
; Revised on : 11/01/95
; Revised by : Dan Shore
; Purpose : To let user choose which set of 20 tagged messages to
; read instead of *forcing* only the first 20. Two new
; subroutines added: DISPLAY_MSG_SETS, GET_NEXT_VALUE
;
; Purpose: Message Command prompt replacement for use with the msg
; tagging PPE's (QSCAN, READ, KILL, RECOVER, MORE, MEC)
;
; To install:
;
; 1) Edit your PCBText file and change the following entry:
;
; MKPCBTXT PCBTEXT /I:425 "!C:\PCB\PPE\QSCAN\MEC.PPE"
; MKPCBTXT PCBTEXT /I:584 "!C:\PCB\PPE\QSCAN\MEC.PPE"
;
; Note: You may have to change the pathname to the PPE.
;
;───────────────────────────────────────────────────────────────────────────
STRING sema_path ' Path and semaphore file
STRING main_prompt ' Common input prompt
STRING hold ' Garbage variable
STRING hold2 ' Garbage variable
STRING page_length_file ' Users original page length
STRING tag_msg_file ' Tagged msgs
STRING start_msg_num ' Starting msg number when reading a set
STRING end_msg_num ' Ending msg number when reading a set
BIGSTR user_input ' Common user input - used with tagged msgs
BIGSTR user_input_temp ' Temp variable for parsing information
BIGSTR temp ' Garbage variable - used with tagged msgs
INT x ' Common INT variable
INT msg_num_count ' Number of tagged messages
INT set_number ' 20 Msg number set
;───────────────────────────────────────────────────────────────────────────
:MAIN
'
' Get path to swap file directory
'
hold = READLINE(PCBDAT(),204)
hold = FILEINF(hold,6) + ":" + FILEINF(hold,7)
'
' Determine paths and names of files used by MEC.PPE
'
sema_path = hold + "msgtag.use"
tag_msg_file = hold + "mtg" + STRING(CURCONF()) + ".lst"
page_length_file = hold + "userpl.dat"
'
' See if the semaphore file exists and then the page length file.
' If page length file exists, read it and restore users original setting
'
IF (EXIST(sema_path)) THEN
IF (EXIST(page_length_file)) THEN
GETUSER
FOPEN 7, page_length_file, O_RD, S_DN
FGET 7, hold
U_PAGELEN = TOINT(hold)
PUTUSER
FCLOSE 7
DELETE page_length_file
END IF
END IF
hold = STRING(LOMSGNUM()) + "-" + STRING(HIMSGNUM())
'
' Display Message Command (tagged file list present) prompt and get response
'
:MEC_PROMPT
'
' See if MTG?.LST file is larger than 0 bytes. If so we have tagged msgs.
'
IF (FILEINF(tag_msg_file,4)> 0) THEN
main_prompt = "@X02[@X0FH@X02]elp,@X02(@X0F" + hold + "@X02),@X02(@X0FTAG/DELTAG@X02), @X0EEnter your message command"
INPUTSTR main_prompt, user_input, @X0E, 250, MASK_ASCII(), UPCASE+LFAFTER+STACKED
user_input = TRIM(user_input," ")
'
' Exit the PPE
'
IF (user_input = "") THEN
KBDSTUFF CHR(13)
END
'
' Read TAGGED MSGs
'
ELSE IF (user_input = "TAG") THEN
'
' Read tagged messages from disk file MTG?.LST
'
GOSUB PROCESS_TAGGED
'
' See how many tokens there are. Remember that TOKCOUNT will only
' report the number of tokens it finds up to the 256th character
' in the string user_input.
'
' It will be able to report more than 20 tokens even if the
' message numbers are 9 characters long.
'
' 9 characters for msg number, 1 char for semi-colon = 10 chars
' 256 characters / 10 = 25.6 msg numbers
'
TOKENIZE user_input
msg_num_count = TOKCOUNT()
IF (msg_num_count > 20) THEN
'
' Display to the user the SETS of 20 tagged messages
'
GOSUB DISPLAY_MSG_SETS
'
' Prompt the user which SET of msgs they wish to read
'
hold = ""
main_prompt = " @X0BChoose set number to read @X0E(Enter=quit)@X07"
INPUTSTR main_prompt, hold, @X0E, 2, MASK_NUM(), LFAFTER+GUIDE+FIELDLEN
IF (hold != "") THEN
'
' temp is a string variable that contains the starting and ending
' message numbers of each set. We read this variable and once
' we get the starting and ending numbers, we can get the whole
' range of numbers (20) from the variable user_input. user_input
' contains ALL the tagged message numbers.
'
TOKENIZE temp
FOR x = 1 to set_number
'
' Retrieve first set of staring and ending message numbers
'
hold2 = GETTOKEN()
'
' See if the loop count matches the users input for set to read
'
IF (x = TOINT(hold)) THEN
'
' Get starting and ending message number
'
start_msg_num = MID(hold2,1,INSTR(hold2,",")-1)
end_msg_num = MID(hold2,INSTR(hold2,",")+1, LEN(hold2)-INSTR(hold2,","))
'
' Get set of 20 message numbers from user_input and put
' range in user_input. Break out of FOR loop so we can
' stuff the keyboard user_input
'
user_input = MID(user_input, INSTR(user_input, start_msg_num), INSTR(user_input, end_msg_num) - INSTR(user_input, start_msg_num) + LEN(end_msg_num))
BREAK
END IF
NEXT
'
' User hit CR to the Message command prompt
'
ELSE
user_input = ""
END IF
END IF
'
' Stuff keyboard with user_input. (message numbers to read or nothing)
'
KBDSTUFF CHR(13) + "R;" + user_input + CHR(13)
END
'
' Delete Tagged Msgs
'
ELSE IF (user_input = "DELTAG") THEN
DELETE tag_msg_file
NEWLINE
PRINTLN "@X0AYour '@X0ETagged@X0A' Messsage Number list for this conference has been @X0Cdeleted.@X07"
NEWLINE
DELAY 36
KBDSTUFF CHR(13)
END
'
' Process all other entries and pass to PCB to process
'
ELSE
KBDSTUFF user_input + CHR(13)
END
END IF
END IF
'
' Display Message Command (tagged file list NOT present) prompt and get response
'
main_prompt = "(H)elp, (" + hold + "), Enter your Message Command"
INPUTSTR main_prompt, user_input, @X0E, 80, MASK_ASCII(), UPCASE+LFAFTER+STACKED
user_input = TRIM(user_input," ")
'
' If user selected "Q", the QSCAN.PPE will run, so create the semaphore file
'
IF (LEFT(user_input,1) = "Q") THEN
FOPEN 1, sema_path, O_WR, S_DN
FCLOSE 1
END IF
KBDSTUFF user_input + CHR(13)
END
'
' Read the tagged files (disk file) into user_input
'
:PROCESS_TAGGED
FOPEN 1, tag_msg_file, O_RD, S_DN
FREAD 1, user_input, FILEINF(tag_msg_file,4)
FCLOSE 1
RETURN
'
'
'
:DISPLAY_MSG_SETS
'
' Display information screen so user knows what is happening
'
PRINTLN
PRINTLN "@X0E┌──────────────────────────────────────────────────────────────┐"
PRINTLN "│@X0BDue to a limitation of PCBoard, only 20 Message numbers can be@X0E│"
PRINTLN "│@X0Bstacked to read at one time. Pick the @X0DSET NUMBER@X0B of tagged @X0E│"
PRINTLN "│@X0Bmessages you wish to read. @X0E│"
PRINTLN "@X0E└──────────────────────────────────────────────────────────────┘"
PRINTLN
'
' Display our set number heading
'
PRINTLN "@X0FSet # @X0CTagged Message Numbers@X07"
PRINTLN "@X0A───── ────────────────────────────────────────────────────────"
'
' Start our set number at 1, and start the set number display of msg #'s
'
set_number = 1
PRINT SPACE(3-LEN(STRING(set_number))), "@X0F", set_number, SPACE(4)
'
' Initialize variables to starting values
'
' x = the number of message numbers we have printed to the screen
'
' temp is a string variable that contains the starting and ending
' message numbers of each set and has the format of:
'
' start,end;start,end;start,end;
'
x = 0
temp = ""
'
' Place user_input value into user_input_temp so we can parse it
' and not destroy the contents of user_input which we will need once
' the user decides which set to read.
'
user_input_temp = user_input
'
' Process our first number, print it to the screen, and add the
' staring number for this set to temp variable. Increment the
' number of message numbers printed to screen (x)
'
GOSUB GET_NEXT_VALUE
PRINT "@X02", hold, " "
temp = hold + ","
INC x
'
' Process the remaining numbers
'
WHILE (1) DO
'
' If we have reached our 20th message number, do this section
'
IF (x = 20) THEN
'
' If 20th number, add ending number to temp variable,
' and set the number of messages printed to the screen
' to 0 in prepartion for displaying next set.
'
temp = temp + hold + ";"
x = 0
PRINTLN
PRINTLN
'
' Get our next message number
'
GOSUB GET_NEXT_VALUE
'
' If no more message numbers (hold = ""), then break out of WHILE loop
'
IF (hold = "") THEN
temp = temp + hold2 + ";"
BREAK
END IF
'
' Print next set number since we have more message numbers to process
'
INC set_number
PRINT SPACE(3-LEN(STRING(set_number))), "@X0F",set_number, SPACE(4)
'
' Process our first number of the next set, print it to the screen, and
' add the starting number for this set to temp variable. Increment the
' number of message numbers printed to screen (x), and increment the
' set number
'
PRINT "@X02", hold, " "
temp = temp + hold + ","
INC x
'
' Go back to the WHILE statement as we have processed our 20th msg
' number and we do not want to process command below this
'
CONTINUE
'
' If we have reached our 10th message number, go to the next line
' on the screen and print 7 spaces for lining up of message numbers
' in two rows of ten numbers each
'
ELSE IF (x = 10) THEN
PRINTLN
PRINT SPACE(7)
END IF
'
' Process the next number and display it on the screen
'
GOSUB GET_NEXT_VALUE
'
' If no more message numbers (hold = ""), then break out of WHILE loop
'
IF (hold = "") THEN
temp = temp + hold2 + ";"
NEWLINES 2
BREAK
END IF
'
' Print the message number to the screen
'
PRINT "@X02", hold, " "
INC x
hold2 = hold
END WHILE
RETURN
'
' This routine was written due to GETOKEN not being able to parse past
' the 256th character of a string. Reported to CDC on 11/1/95
'
' hold is the variable that contains the next value
' parsed from the user_input_temp variable
'
:GET_NEXT_VALUE
hold = MID(user_input_temp, 1, INSTR(user_input_temp, ";")-1)
user_input_temp = MID(user_input_temp, INSTR(user_input_temp, ";")+1, LEN(user_input_temp)-INSTR(user_input_temp,";"))
RETURN